-
-
Notifications
You must be signed in to change notification settings - Fork 832
Make social icon configuration more flexible
#3025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: bd5f90f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
size-limit report 📦
|
| // Link to Twitter account if set in Starlight config. | ||
| if (config.social?.twitter) { | ||
| const twitterLink = config.social?.find(({ icon }) => icon === 'twitter' || icon === 'x.com'); | ||
| if (twitterLink) { | ||
| headDefaults.push({ | ||
| tag: 'meta', | ||
| attrs: { | ||
| name: 'twitter:site', | ||
| content: new URL(config.social.twitter.url).pathname, | ||
| content: new URL(twitterLink.href).pathname, | ||
| }, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will overlap with #2927 but thankfully it’s small and easy to update for whichever PR merges second.
HiDeoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks amazing and definitely more flexible for users 👏
Left a few link suggestions and thoughts but nothing blocking 👍
Co-authored-by: HiDeoo <[email protected]>

Description
This PR changes how social links are configured in the Starlight options.
It switches from a shorthand object syntax to an array of explicit link items:
This is a little unfortunate in that it’s a more verbose configuration approach, but it has a few advantages for long-term maintenance:
Icons no longer need dedicated built-in labels and code to be used as social links. Any icon can be used if people want (avoiding us needing to decide what counts as a valid social link and what doesn’t).
User control of labels means that less common links can be labelled accurately. For example, we avoided adding an
emailsocial icon because the label could vary depending on site language and context. This change allows people to use the existingemailicon with a label of their choosing.Following Add support for custom icons #3024, this should be updated to also support user-installed icons reducing the pressure on Starlight to contain icons for every platform in the known universe.
Not in scope
Also considered
label).